<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>order</title>
    <script>
        //循环录入十个数
        let  arr=[];
        let i = 0;
        while (arr.length<10){
            i++;
            let ord=prompt("请输入第"+i+"个数");
            ord=Number(ord);
            arr.push(ord)
        }
        //降序
        for (let i = 0; i < arr.length - 1; i++) {
            for (let j = 0; j < arr.length - i - 1; j++) {
                if (arr[j] < arr[j + 1]) {
                    let t = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = t;
                }
            }
        }
        document.write("降序arr=" + arr+"<br>");
        //升序
        for (let i = 0; i < arr.length - 1; i++) {
            for (let j = 0; j < arr.length - i - 1; j++) {
                if (arr[j] > arr[j + 1]) {
                    let t = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = t;
                }
            }
        }
        document.write("升序arr=" + arr+"<br />");
        //最大值最小值
        let max = arr[0];
        let min = arr[0];
        let n = 0;
        while (n < arr.length) {
            n++;
            if (max < arr[n]) {
                max = arr[n];
            }
            if (min > arr[n]) {
                min = arr[n];
            }
        }
        document.write("最大值为："+max + "<br />");
        document.write("最小值为："+min+ "<br />")
        //反转数组
        let start = 0;
        let end = arr.length - 1;
        while (start <=end) {
            let t = arr[start];
            arr[start] = arr[end];
            arr[end] = t;
            start++;
            end --;
        }
        document.write("反转后的数组为："+arr);
        //删除数组元素


    </script>
</head>
<body>

</body>
</html>